const exec = require('../conf/mysql')
const login = (userName, userPass) => {
  const sql = `select username from users where username='${userName}' and pwd='${userPass}'`
  return exec(sql).then(res=>{
    if(res.length){
      return res[0]
    }else{
      return null
    }
  })
};

module.exports = {
  login,
};
